﻿<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	com.zxy.tcp.ServerPageHttp sph = new com.zxy.tcp.ServerPageHttp();
	sph.strIP = request.getRemoteAddr();
	Map map = request.getParameterMap();
	Set keSet = map.entrySet();
	String strUTF8 = "";
	String strGBK = "";
	String strISO = "";
	for(Iterator itr = keSet.iterator();itr.hasNext();)
	{
		Map.Entry me = (Map.Entry) itr.next();
		Object okey = me.getKey(); //获取参数名
		Object ov = me.getValue(); //获取参数值
		String[] value = new String[1];
		if(ov instanceof String[])
		{
			value = (String[]) ov;
		}else
		{
			value[0] = ov.toString();
		}
		for(int k = 0;k < value.length;k++)
		{
			//strUTF8 += new String(value[k].getBytes("utf-8"),"utf-8");
			//strGBK += new String(value[k].getBytes("GBK"),"utf-8");
			//strISO += new String(value[k].getBytes("iso-8859-1"),"utf-8");
			String strTem = new String(value[k].getBytes("utf-8"),"utf-8");//iso-8859-1
			if(sph.strUrl.toString().length() != 0)
				sph.strUrl.append("&" + okey + "=" + strTem);//value[k];
			else
				sph.strUrl.append(okey + "=" + strTem); //value[k];
		}
	}
	//获取post数据
	StringBuffer data = new StringBuffer();
	java.io.BufferedReader reader = null;
	try
	{
		reader = new java.io.BufferedReader(new java.io.InputStreamReader(request.getInputStream()));
		String s;
		while((s = reader.readLine()) != null)
		{
			data.append(s);
		}
	}
	catch(java.io.IOException e)
	{
		e.printStackTrace();
	}
	sph.strUrl.append("&"+data.toString());
	StringBuilder strResult = sph.PageResult();
	response.getWriter().write(strResult.toString());
%>